<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Raster</title>
    <link rel="stylesheet" href="../css/style.css">
    <script type="text/javascript" src="../../dist/paper-full.js"></script>
    <script type="text/paperscript" canvas="canvas1">
        var raster = new Raster('marilyn'); // new Raster('http://assets.paperjs.org/images/marilyn.jpg');
        raster.onLoad = function() {
            raster.position = view.center;
            raster.rotate(45);
            window.importJSON(project.exportJSON());
        }
    </script>
    <script type="text/paperscript" canvas="canvas2">
        window.importJSON = function(json) {
            paper.activate();
            console.log(json);
            project.importJSON(json);
        }
    </script>
</head>
<body>
    <canvas id="canvas1" width="512" height="512"></canvas>
    <canvas id="canvas2" width="512" height="512"></canvas>
    <img id="marilyn" width="512" height="512" style="display: none;" src=""/>
</body>
</html>
